package com.wms.service.impl;

import com.wms.entity.Province;
import com.wms.mapper.AreaMapper;
import com.wms.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class AreaServiceImpl implements AreaService {
    @Autowired
    AreaMapper areaMapper;

    /**
     * 获取全国所有省份的三级结构
     */
    public List<Province> getAllProvinces() {
        return areaMapper.selectAllProvinces();
    }

    /**
     * 根据省份ID获取单个省份的三级结构
     */
    public Province getProvinceWithChildren(Integer provinceId) {
        return areaMapper.selectProvinceWithChildren(provinceId);
    }
}
